package com.luzhikun.service.impl;

import com.luzhikun.dao.UserDao;
import com.luzhikun.domain.User;
import com.luzhikun.service.IUserService;
import com.luzhikun.util.SqlSessionUtil;

/**
 * @Author Rookie Coder
 * @Description
 * @Date
 **/
public class IUserServiceImpl implements IUserService {

    private UserDao userDao= SqlSessionUtil.getSqlSession().getMapper(UserDao.class);

    // 获取
    @Override
    public User loginUser(String username) {
        if (userDao.userLogin(username)==null){
            System.out.println("空的");
        }
        else {
            System.out.println("有数据");
        }
        return userDao.userLogin(username);
    }

    @Override
    public User userId() {

        return userDao.userId();
    }

    @Override
    public void userIndex(String username, String password,String phone) {
        userDao.userIndex(username,password,phone);
    }

    /*
     * @Author liu-miss
     * @Description 查询是否有相同电话号码的人
     * @Date 14:01 2021/5/24
     * @Param [phone]
     * @return int
     **/
    public User useerIndexSerlectByPhone(String phone){
        return userDao.indexSelectPhone(phone);
    }

}
